import os
import time
from concurrent.futures.process import ProcessPoolExecutor


def work(name):
    for i in range(4):
        time.sleep(1)
        print(f"----{name}----{i}")
        return f'{name}进程返回的结果'

def main():
    with ProcessPoolExecutor(max_workers=1) as pool:
        res=pool.map(work,["musen","zhangsan","lisi"])
        print(list(res))

        # for i in ["musen","zhangsan","lisi"]:
        #     ts=pool.submit(work,i)
        #     print(ts.result())


if __name__ == '__main__':
    st=time.time()
    main()
    et=time.time()
    print(et-st)